package Homework;

import java.util.ArrayList;
import java.util.Collections;
import java.util.HashSet;

//测试类---用HashSet写
public class StudentTest1 {

		public static void main(String[] args) {
			HashSet<Student> hashSet = new HashSet<Student >();
			hashSet.add(new Student("Jack", "男", 58));
			hashSet.add(new Student("Lucy","女", 98));
			hashSet.add(new Student("Tom", "男", 77));
			hashSet.add(new Student("William", "男", 39));
			hashSet.add(new Student("James", "男", 82));
			hashSet.add(new Student("Selina", "女", 100));
			
			ArrayList<Student> arrayList = new ArrayList<>(hashSet);
			
			Collections.sort(arrayList);
			for(Student stu: arrayList) {
				System.out.println(stu);
			}
		}
}
